#include "Messages.h"
#include "..\Game Objects\CPlayer.h"
#include "..\Game Objects\CPistolBullet.h"
#include "..\Game Objects\CShotgunBullet.h"
#include "..\Game Objects\CRocketLauncherBullet.h"
#include "..\Game Objects\CTurret.h"
#include "..\Game Objects\CSpider.h"
#include "..\Game Objects\CDrop.h"
#include "..\Game Objects\CGrenade.h"
#include "..\Firewall.h"

// Define message classes here
//////////////////////////////////////

// Create player bullet
CCreatePlayerBulletMessage::CCreatePlayerBulletMessage(CBase* pBase, int nType) : CBaseMessage(MSG_CREATE_PLAYER_BULLET)
{
	m_pBase = pBase;
	m_pBase->AddRef();

	m_nType = nType;
}

CCreatePlayerBulletMessage::~CCreatePlayerBulletMessage(void)
{
	m_pBase->Release();
}

// Destroy player bullet
CDestroyPlayerBulletMessage::CDestroyPlayerBulletMessage(CPistolBullet* pCB) : CBaseMessage(MSG_DESTROY_PLAYER_BULLET)
{
	m_pBullet = pCB;
	m_pBullet->AddRef();
}

CDestroyPlayerBulletMessage::~CDestroyPlayerBulletMessage(void)
{
	m_pBullet->Release();
}

// Create shotgun bullet
CCreateShotgunBulletMessage::CCreateShotgunBulletMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_SHOTGUN_BULLET)
{
	m_pBase = pBase;
	m_pBase->AddRef();
}

CCreateShotgunBulletMessage::~CCreateShotgunBulletMessage(void)
{
	m_pBase->Release();
}

// Destroy shotgun bullet
CDestroyShotgunBulletMessage::CDestroyShotgunBulletMessage(CShotgunBullet* pCB) : CBaseMessage(MSG_DESTROY_SHOTGUN_BULLET)
{
	m_pBullet = pCB;
	m_pBullet->AddRef();
}

CDestroyShotgunBulletMessage::~CDestroyShotgunBulletMessage(void)
{
	m_pBullet->Release();
}

// Create rocket launcher bullet
CCreateRocketBulletMessage::CCreateRocketBulletMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_ROCKET_BULLET)
{
	m_pBase = pBase;
	m_pBase->AddRef();
}

CCreateRocketBulletMessage::~CCreateRocketBulletMessage(void)
{
	m_pBase->Release();
}

// Destroy rocket launcher bullet
CDestroyRocketBulletMessage::CDestroyRocketBulletMessage(CRocketLauncherBullet* pCB) : CBaseMessage(MSG_DESTROY_ROCKET_BULLET)
{
	m_pBullet = pCB;
	m_pBullet->AddRef();
}

CDestroyRocketBulletMessage::~CDestroyRocketBulletMessage(void)
{
	m_pBullet->Release();
}

// Create exception grenade
CCreateExGrenadeMessage::CCreateExGrenadeMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_EXGRENADE)
{
	m_pBase = pBase;
	m_pBase->AddRef();
}

CCreateExGrenadeMessage::~CCreateExGrenadeMessage(void)
{
	m_pBase->Release();
}

// Create firewall grenade
CCreateFwGrenadeMessage::CCreateFwGrenadeMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_FWGRENADE)
{
	m_pBase = pBase;
	m_pBase->AddRef();
}

CCreateFwGrenadeMessage::~CCreateFwGrenadeMessage(void)
{
	m_pBase->Release();
}

// Destroy grenade message
CDestroyGrenadeMessage::CDestroyGrenadeMessage(CGrenade* pG) : CBaseMessage(MSG_DESTROY_GRENADE)
{
	m_pGrenade = pG;
	m_pGrenade->AddRef();
}

CDestroyGrenadeMessage::~CDestroyGrenadeMessage(void)
{
	m_pGrenade->Release();
}

// Create turret message
CCreateTurretMesssage::CCreateTurretMesssage(float fPosX, float fPosY) : CBaseMessage(MSG_CREATE_TURRET)
{

}

CCreateTurretMesssage::~CCreateTurretMesssage(void)
{

}

// Destroy turret message
CDestroyTurretMessage::CDestroyTurretMessage(CTurret* pCT) : CBaseMessage(MSG_DESTROY_TURRET)
{

}

CDestroyTurretMessage::~CDestroyTurretMessage(void)
{

}

// Create spider message
CCreateSpiderMessage::CCreateSpiderMessage(float fPosX, float fPosY) : CBaseMessage(MSG_CREATE_SPIDER)
{

}

CCreateSpiderMessage::~CCreateSpiderMessage(void)
{

}

// Destroy spider message
CDestroySpiderMessage::CDestroySpiderMessage(CSpider* pSpider) : CBaseMessage(MSG_DESTROY_SPIDER)
{

}

CDestroySpiderMessage::~CDestroySpiderMessage(void)
{

}

// Create pistol drop message
CCreatePistolDropMessage::CCreatePistolDropMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_PISTOL_DROP)
{
	m_pBase = pBase;
	m_pBase->AddRef();
}

CCreatePistolDropMessage::~CCreatePistolDropMessage(void)
{
	m_pBase->Release();
}

// Create shotgun drop message
CCreateShotgunDropMessage::CCreateShotgunDropMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_SHOTGUN_DROP)
{
	m_pBase = pBase; 
	m_pBase->AddRef();
}

CCreateShotgunDropMessage::~CCreateShotgunDropMessage(void)
{
	m_pBase->Release();
}

// Create rocket drop message
CCreateRocketDropMessage::CCreateRocketDropMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_ROCKET_DROP)
{
	m_pBase = pBase;
	m_pBase->AddRef();
}

CCreateRocketDropMessage::~CCreateRocketDropMessage(void)
{
	m_pBase->Release();
}

// Create health drop message
CCreateHealthDropMessage::CCreateHealthDropMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_HEALTH_DROP)
{

	m_pBase = pBase;
	m_pBase->AddRef();
}

CCreateHealthDropMessage::~CCreateHealthDropMessage(void)
{
	m_pBase->Release();
}

// Create exception grenade drop message
CCreateExGrenadeDropMessage::CCreateExGrenadeDropMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_EXGRENADE_DROP)
{
	
	m_pBase = pBase;
	m_pBase->AddRef();
}

CCreateExGrenadeDropMessage::~CCreateExGrenadeDropMessage(void)
{
	m_pBase->Release();
}
CCreateFwGrenadeDropMessage::CCreateFwGrenadeDropMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_FWGRENADE_DROP)
{
	m_pBase = pBase;
	m_pBase->AddRef();
}

CCreateFwGrenadeDropMessage::~CCreateFwGrenadeDropMessage(void)
{
	m_pBase->Release();
}
// Destroy drop message
CDestroyDropMessage::CDestroyDropMessage(CDrop* pDrop) : CBaseMessage(MSG_DESTROY_DROP)
{
	m_pDrop = pDrop;
	m_pDrop->AddRef();
}

CDestroyDropMessage::~CDestroyDropMessage(void)
{
	m_pDrop->Release();
}

// Destroy firewall message
CDestroyFirewallMessage::CDestroyFirewallMessage(Firewall* pFire) : CBaseMessage(MSG_DESTROY_FIREWALL)
{
	m_pFire = pFire;
	//m_pFire->AddRef();
}

CDestroyFirewallMessage::~CDestroyFirewallMessage(void)
{
	//m_pFire->Release();
}

// Create speed upgrade message
CCreateSpeedUpgradeMessage::CCreateSpeedUpgradeMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_SPEED_UPGRADE)
{
	m_pBase = pBase;
	m_pBase->AddRef();
}

CCreateSpeedUpgradeMessage::~CCreateSpeedUpgradeMessage(void)
{
	m_pBase->Release();
}

// Create fire rate upgrade message
CCreateFRUpgradeMessage::CCreateFRUpgradeMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_FR_UPGRADE)
{
	m_pBase = pBase;
	m_pBase->AddRef();
}

CCreateFRUpgradeMessage::~CCreateFRUpgradeMessage(void)
{
	m_pBase->Release();
}
CCreateMoneyUpgradeMessage::CCreateMoneyUpgradeMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_MONEY_UPGRADE)
{
	m_pBase = pBase;
	m_pBase->AddRef();
}

CCreateMoneyUpgradeMessage::~CCreateMoneyUpgradeMessage(void)
{
	m_pBase->Release();
}
CCreateNothingUpgradeMessage::CCreateNothingUpgradeMessage(CBase* pBase) : CBaseMessage(MSG_CREATE_NOTHING_UPGRADE)
{
	m_pBase = pBase;
	m_pBase->AddRef();
}

CCreateNothingUpgradeMessage::~CCreateNothingUpgradeMessage(void)
{
	m_pBase->Release();
}